﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[FUT_GET_ConstEquipas]
			@IDJogos as numeric(18)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
	select 
	u.NomeUtilizador,
	EQ.NomeEquipa
	from dbo.ConstituicaoEquipas CE
	inner join dbo.Jogadores JG
	ON CE.IDJogador = JG.UserID
	inner join dbo.Equipas EQ
	ON CE.IDEquipa = EQ.IDEquipa
	inner join utilizadores u
	on ce.IDJogador = u.IDUser
	where idjogos = @IDJogos order by EQ.IDequipa

END